/**
 * 用户页面接口
 */
import request from "@/utils/request";
import env from "@/utils/env";
import { getItem, setItem } from "@/utils/localStorage";
import { getToken } from "../../utils/auth";

// 我的喜欢
export const myFavorite = (pageNo = 1, pageSize = 5) => {
  return request({
    method: "GET",
    url: `/studio/user/lchDetail/like/${
      getItem("userInfo").id
    }?pageNo=${pageNo}&pageSize=${pageSize}`,
  });
};

// 我的收藏
export const myCollection = (pageNo = 1, pageSize = 5) => {
  return request({
    method: "GET",
    url: `/studio/user/lchDetail/collect/${
      getItem("userInfo").id
    }?pageNo=${pageNo}&pageSize=${pageSize}`,
  });
};

// 浏览历史
export const watchHistory = (pageNo = 1, pageSize = 5) => {
  return request({
    method: "GET",
    url: `/studio/user/lchDetail/history/${
      getItem("userInfo").id
    }?pageNo=${pageNo}&pageSize=${pageSize}`,
  });
};

// 退出登录
export const logoutApi = () => {
  return request({
    method: "POST",
    url: "/studio/user/logout",
  });
};

//修改用户数据
export const updateUserData = (data) => {
  return request({
    method: "POST",
    // url: "/front/user/modify/user",
    url: "/studio/user/update",
    data,
  });
};
